package 富婆梦.第一阶段.Java基础视频学习.IO流学习.File类练习;

import java.io.File;

/**
 * @ProjectName: java-learning
 * @Package: 富婆梦.第一阶段.Java基础视频学习.IO流学习.File类练习
 * @ClassName: FileDemo3
 * @Author: hemengjin
 * @Description: 获取文件对象
 * @Date:2021/11/21 16:44
 * @Version: 1.0
 */
public class FileDemo3 {
    public static void main(String[] args) {
        File file1 = new File("D:\\tool");
        String[] names = file1.list();
        File[] files = file1.listFiles();
        for (String name:names){
            System.out.println(name);
        }
        for (File file:files){
            System.out.println(file);
        }
    }
}
